package com.liyi.dao;

import javax.inject.Inject;

import org.springframework.stereotype.Repository;

import com.zero.basic.dao.DefaultBaseDao;
import com.zero.basic.dao.SqlQueryBaseDao;
import com.zero.basic.exception.SmsDaoException;

@Repository("salaryItemDaoLiyi")
public class SalaryItemDaoImpl extends DefaultBaseDao<SalaryItemDao> implements SalaryItemDao {
	@Inject
	private SqlQueryBaseDao<?> sqlQueryBaseDao;

	@Override
	public String getSalaryItemTypeBySalaryItemId(String salaryItemId) throws SmsDaoException {
		try {
			// 声明SQL语句
			String sql = "select salary_item_type from t_salary_item where salary_item_id = " + salaryItemId;
			// 获取查询结果
			String type = (String) sqlQueryBaseDao.queryBySql(sql, null, null, false, false);
			// 返回查询结果
			return type;
		} catch (Exception e) {
			throw new SmsDaoException();
		}
	}

	@Override
	public String getSalaryItemAddTypeBySalaryItemId(String salaryItemId) throws SmsDaoException {
		try {
			// 声明SQL语句
			String sql = "select salary_add_item from t_salary_item where salary_item_id = " + salaryItemId;
			// 获取查询结果
			String add = (String) sqlQueryBaseDao.queryBySql(sql, null, null, false, false);
			// 返回查询结果
			return add;
		} catch (Exception e) {
			throw new SmsDaoException();
	}
	}

}
